<?php echo $head?>
<div class="right-content">
    <ul class="nav nav-tabs">
        <li><a href="add">添加商品</a></li>
        <li class="active"><a href="index">商品列表</a></li>
    </ul>
    <style>
        th{
            text-align: center !important;
        }
        td{
            text-align: center !important;
            white-space: normal !important;
            word-break: break-all !important;
        }
    </style>
    <form action="" method="get" class="form-horizontal" role="form">
        <div class="panel panel-info">
            <div class="panel-heading">筛选</div>
            <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">关键字</label>
                    <div class="col-xs-12 col-sm-2 col-lg-2">
                        <input class="form-control" name="keyword" type="text" value="" placeholder="请输入商品名称">
                    </div>
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">状态</label>
                    <div class="col-xs-12 col-sm-2 col-lg-2">
                        <select name="status" class="form-control">
                            <option value="">全部</option>
                            <option value="0">隐藏</option>
                            <option value="1">显示</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label"></label>
                    <div class=" col-xs-12 col-sm-2 col-lg-2">
                        <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <div class="panel panel-default">
        <div class="table-responsive panel-body">
            <table class="table table-hover">
                <thead class="navbar-inner">
                <tr>
                    <th>排序</th>
                    <th>商品名称</th>
                    <th>商品图片</th>
                    <th>闯关价格<br>商品原价</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody id="level-list">
                <?php
                foreach($data as $k=>$v)
                {
                    $status = '显示';
                    $label = 'label label-success';
                    if($v['status'] == 0){
                        $status = '隐藏';
                        $label = 'label label-default';
                    }
                    echo '<tr>
                    <td>'.$v['sort'].'</td>
                    <td>'.$v['name'].'</td>
                    <td><img src="'.$v['pic'].'" style="width:60px;height:60px;"></td>
                    <td>'.$v['play_money'].'<br>'.$v['original_price'].'</td>
                    <td><a href="offline?id='.$v['id'].'"><label class="'.$label.'" >'.$status.'</label></a></td>
                    <td>
                        <a class="btn btn-default btn-sm" href="save?id='.$v['id'].'">编辑</a>
                    </td>
                    <input type="hidden" class="ids" name="for_'.$k.'"  value="'.$v['id'].'">
                </tr>';
                }
                ?>
                </tbody>
            </table>
        </div>
    </div>

</div>